package cn.sofwin.blog;

import cn.sofwin.web.blog.entity.Admin;
import cn.sofwin.web.blog.service.AdminService;
import cn.sofwin.web.blog.service.impl.AdminServiceImpl;
import org.apache.commons.mail.Email;
import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.SimpleEmail;
import org.junit.Test;

//邮件测试
public class test {
    @Test
    public  void testSend() throws EmailException {
        Email email=new SimpleEmail();
        email.setHostName("smtp.ym.163.com");
        email.setSSLOnConnect(true);
        email.setSmtpPort(994);
        email.setAuthentication("teach@xiaowo.me","123456");

        email.setFrom("teach@xiaowo.me","你大爷","utf-8");
        email.setSubject("教学邮件测试");
        email.addTo("2587937553@qq.com");
        email.setMsg("这是java发送的邮件");

        email.send();
    }
    @Test
    public void test22(){
        AdminService adminService= AdminServiceImpl.getInstance();
        Admin l = adminService.findByName("朱婷");
        System.out.println(l);
    }
}
